import Vue from 'vue';
import VueRouter from 'vue-router';
import User from '../views/User';
import About from '../views/About';
import Dept from '../views/Dept';
import Setting from '../views/Setting';
import Index from '../views/Index';
import Login from '../views/Login.vue';

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login,       
    },   


    {
        path: '/user',
        name: '用户管理',
        component: Index,
        redirect: '/user',
        show: true,
        children: [
            {
                path: '/user',
                name: '用户管理',
                component: User,
            },
            {
                path: '/dept',
                name: '部门管理',
                component: Dept,
            },
        ],
    },

    {
        path: '/navigation',
        name: '设置',
        component: Index,
        show: false,
        children: [
            {
                path: '/setting',
                name: '设置',
                component: Setting,
            },
            {
                path: '/about',
                name: 'About',
                component: About,
            },
        ],
    },
];

const router = new VueRouter({
    mode: 'history',
    routes,
});

export default router;
